﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VQData;
using System.Data;
using System.Data.Linq;
using VQWEB.common;
namespace VQWEB.administrator.sources
{
    public class CoreData
    {
        public static IList<object> ViewCategory(string type)
        {
            BusinessLayer<HuongNghiepModelDataContext> bussiness = new BusinessLayer<HuongNghiepModelDataContext>();
            IList<object> list = bussiness.List<core_category>(
                null,
                null,
                n=>n.category_type.Equals(type),
                n => n.category_title,
                n => new
                {
                    id = n.category_id,
                    ten = n.category_title,
                    content = n.category_content,
                    type = n.category_type,
                    active = n.category_active

                });
            return list;
        }
        public static IList<object> ViewTag()
        {
            BusinessLayer<HuongNghiepModelDataContext> bussiness = new BusinessLayer<HuongNghiepModelDataContext>();
            IList<object> list = bussiness.List<core_tag>(
                null,
                null,
                null,
                null,
               c => new
               {
                   id = c.tag_id,
                   keyword = c.tag_keyword,
                   hit = c.tag_hit,
                   type = c.tag_type,
                   active = c.tag_active
               });
            return list;
        }
    }
}